Skip to content

feat: Log stats of artifact pull command#63

Merged
skipi merged 2 commits intomasterfrom
has/pull-size-stats
Aug 19, 2025
Merged

feat: Log stats of artifact pull command#63
skipi merged 2 commits intomasterfrom
has/pull-size-stats

Conversation

@hamir-suspect
Copy link
Contributor

Enhanced Artifact Pull Logging

Added detailed logging to artifact pull operations that displays file count and total size in human-readable format.

Changes:

  • Storage Layer (pkg/storage/pull.go):

    • Added PullStats struct to track FileCount and TotalSize
    • Modified Pull() function to return statistics alongside paths
    • Updated doPull() to collect file size information during downloads
  • Command Layer (cmd/pull.go):

    • Enhanced all pull commands (job, workflow, project) to display statistics
    • Added formatBytes() utility for human-readable size formatting
    • Updated function signatures to handle new statistics return value
  • Tests (cmd/pull_test.go, pkg/storage/pull_test.go):

    • Added comprehensive unit tests for formatBytes() function
    • Added storage-level tests for statistics tracking
    • Verified integration with existing functionality

Result:

Pull operations now display enhanced logging:

Successfully pulled artifact for current job.
* Remote source: 'path/to/source'.
* Local destination: 'path/to/destination'.
Pulled 698 files. Total of 498MB

Breaking Changes: None - backward compatible enhancement.

@skipi skipi force-pushed the has/pull-size-stats branch from ac97288 to 3d52415 Compare August 19, 2025 12:30
@skipi skipi merged commit 7716a01 into master Aug 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants